public class Reader {
    // 声明类的属性（关键：之前缺失了这一步）
    private String cardId;
    private String name;
    private String contact;
    private int borrowedCount;

    // 构造方法：初始化读者所有属性
    public Reader(String cardId, String name, String contact) {
        this.cardId = cardId;
        this.name = name;
        this.contact = contact;
        this.borrowedCount = 0; // 初始借阅数量为0
    }

    // Getter方法：获取各属性值
    public String getCardId() { return cardId; }
    public String getName() { return name; }
    public int getBorrowedCount() { return borrowedCount; }

    // 借阅图书时：增加借阅数量
    public void incrementBorrowedCount() { this.borrowedCount++; }

    // 归还图书时：减少借阅数量
    public void decrementBorrowedCount() { this.borrowedCount--; }

    // 重写toString：便于打印读者信息
    @Override
    public String toString() {
        return "借书证号：" + cardId + "，姓名：" + name + "，联系方式：" + contact + "，当前借阅数：" + borrowedCount;
    }
}